<template>
    <div>
        <van-nav-bar left-text="返回" left-arrow @click-left="onClickLeft" />
        <van-address-edit :area-list="areaList" show-postal show-delete show-set-default show-search-result
            :search-result="searchResult" :area-columns-placeholder="['请选择', '请选择', '请选择']" @save="onSave"
            @delete="onDelete" @change-detail="onChangeDetail" />
    </div>
</template>
<script>
import { Toast } from 'vant';
import { areaList } from '@vant/area-data'
import {saved} from '@/api/index';
export default {
    data() {
        return {
            areaList,
            searchResult: [],
        };
    },
    methods: {
        onSave(val) {
            Toast('save');
            saved(val).then(res => {
               if(res.data.errmsg=="成功"){
            this.$router.push({ path: '/setorder' })
               }
            })
        },
        onDelete() {
            Toast('delete');
        },
        onChangeDetail(val) {

        },
        onClickLeft() {
            this.$router.push({ path: '/setorder' })
        },
    },

}



</script>